public boolean chkPalindrome() {
        // write code here
        if(head == null) {
        return true;
        }
        //1.找中间节点
        ListNode fast = head;
        ListNode slow = head;
        while(fast != null && fast.next != null) {
        fast = fast.next.next;
        slow = slow.next;
        }
        //2.slow的位置就是中间位置,开始翻转
        ListNode cur = slow.next;
        while (cur != null) {
        ListNode curN = cur.next;
        cur.next = slow;
        slow = cur;
        cur = curN;
        }
        //3.开始判断回文
        while(slow != head) {
        if(head.val != slow.val) {
        return false;
        }
        if(head.next == slow) {
        return true;
        }
        head = head.next;
        slow = slow.next;
        }
        return true;
        }